package be.gnx.fogo.application.dao;

import be.gnx.fogo.application.model.Surname;

public class SurnameDao extends ObjectDao<Surname, String> {

  public SurnameDao() {
    super(Surname.class, "value");
  }

  public Surname findOrCreate(String value) {
    Surname surname = get(value);
    if (surname == null) {
      surname = new Surname();
      surname.setValue(value);
      save(surname);
    }
    return surname;
  }

}
